﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Microsoft.PowerShell.CmdletManagement"
    x:Class="Microsoft.PowerShell.CmdletManagement.AddCmdlet"
    Title="Add a Cmdlet" Height="480" Width="500" 
    WindowStyle="ToolWindow" 
    WindowStartupLocation="CenterScreen" 
     ShowInTaskbar="False" ResizeMode="NoResize" >

	<DockPanel>
		<StackPanel DockPanel.Dock="Bottom">
			<Rectangle Fill="{DynamicResource DialogBorderColor}" Height="1" Margin="0,5,0,3"/>

			<StackPanel HorizontalAlignment="Right" Margin="0,5,0,10" Orientation="Horizontal" >
				<Button Click="Click_Ok" IsDefault="True" Width="70" Margin="0,0,10,0" Height="Auto" Content="OK"/>
				<Button Click="Click_Cancel" IsDefault="False" Width="70" Margin="0,0,10,0" Height="Auto" Content="Cancel"/>
			</StackPanel>
		</StackPanel>
		
		
		<StackPanel>

			<TextBlock Name="TopInstructions" VerticalAlignment="Top" TextWrapping="Wrap" Margin="5,5,5,2"
					   FontWeight="Bold"><Run Text="Select Verb and Noun"/></TextBlock>
			
			<local:ExtendedListBox x:Name="Verb" Label="Verb"
							 HelpText="What action this cmdlet takes"
                             IsReadOnly="False"
                             />
			<local:ExtendedListBox x:Name="Noun" Label="Noun"
                             HelpText="The resource that this cmdlet works with"
                             IsReadOnly="False"
							 />

			<StackPanel Margin="5,10,7,2" >
				<TextBlock Name="SecondInstructions" VerticalAlignment="Top" TextWrapping="Wrap" Margin="0,5,0,2"
					   FontWeight="Bold"><Run Text="Start from an existing cmdlet?"/></TextBlock>
				
				<TextBlock Name="Instructions" VerticalAlignment="Top" TextWrapping="Wrap" Margin="0,0,0,5">
					You may optionally pre-populate data from a cmdlet that already exists.
					To load data from a cmdlet, select it from the list below.
				</TextBlock>
				<TextBox Name="CmdletSearch" TextChanged="Search_TextChanged"
						 GotFocus="Search_GotFocus" LostFocus="Search_LostFocus"
						 VerticalAlignment="Top" Foreground="#88000000">Search</TextBox>
				
				<ListView Margin="0,10,0,10"
						  Loaded="Cmdlet_Loaded"
						  Name="CmdletList" ItemsSource="{Binding}"
						  SelectionMode="Single"
						  Height="175" 
						  VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
						  >
					<ListView.View>
						<GridView x:Name="CmdletsView">
							<GridViewColumn DisplayMemberBinding="{Binding Verb}" >
								<GridViewColumnHeader Content="Verb" MinWidth="120" />
							</GridViewColumn>
							<GridViewColumn DisplayMemberBinding="{Binding Noun}">
								<GridViewColumnHeader Content="Noun" MinWidth="120" />
							</GridViewColumn>
							<GridViewColumn DisplayMemberBinding="{Binding ShortDescription}">
								<GridViewColumnHeader Content="Short Description" MinWidth="120" />
							</GridViewColumn>
						</GridView>
					</ListView.View>
				</ListView>
			</StackPanel>


		</StackPanel>

	</DockPanel>
</Window>
